
package com.rexolar.openapi.context;

import com.rexolar.openapi.constants.PublicParamsConstants;
import lombok.Data;

import java.util.Map;

/**
 * OpenContext
 *
 * @author zhusiyu
 **/
@Data
public class OpenContext {


    private final String appKey;
    private String reqId;
    private final Long requestTime;
    private final String requestIp;
    private final String requestUri;

    private Map<String, String> paramsMap;

    public OpenContext(String requestIp, Map<String, String> paramsMap, String uri) {
        this.requestTime = System.currentTimeMillis();
        this.requestIp = requestIp;
        this.requestUri = uri;
        this.paramsMap = paramsMap;
        this.appKey = paramsMap.get(PublicParamsConstants.APPKEY);
    }
}
